	//固定导航栏
	function getScroll(){
		return{
			top:window.pageYOffset||document.documentElement.ScrollTop||document.body.ScrollTop||0
		}
	}
	window.onscroll = function(){
		if(getScroll().top>=64){
			$class('.top_two').className = "top_two fix";
			$class('.main').style.marginTop = 40+"px";
		}else{
			$class('.top_two').className = "top_two";
			$class('.main').style.marginTop = "";
		}
	}

	//手风琴
	var bottom_box = document.querySelector('.bottom_box');
	var liss = bottom_box.getElementsByTagName('li');
		for(var i = 0;i<liss.length;i++){
		 	liss[i].onmouseenter = function(){
		 		for(var k = 0;k<liss.length;k++){
		 			animate(liss[k],{'width':115},25);
		 		}
		 		animate(this,{'width':225},25);
		 	}
		 	liss[i].onmouseleave = function(){
		 		animate(this,{"width":115},25);
		 	}
		 }

	//背景渐变动画函数
	function getStyle(ele,str){
		if(window.getComputedStyle){
			return getComputedStyle(ele,null)[str];
		}else{
			return ele.currentStyle[str];
		}
	}
	function animate(ele,json,time,fn){
		clearInterval(ele.timeId);
		// console.log(111);
		ele.timeId = setInterval(function(){
			var flag = true;
			for(var key in json){
				if(key == 'opacity'){
					var current = getStyle(ele,key)*100;
					var target = json[key]*100;
					var step = (target - current)/10;
					step = step>0?Math.ceil(step):Math.floor(step);
					current += step;
					ele.style[key] = current/100;
				}else if(key == "zIndex"){
					ele.style[key] = json[key];
				}else{
					var current = parseInt(getStyle(ele,key));
					var target = json[key];
					var step = (target-current)/10;
					step = step>0?Math.ceil(step):Math.floor(step);
					current += step;
					ele.style[key] = current + "px";
					}
					if(current!=target){
						flag=false;
					}
				}
			if(flag){
				clearInterval(ele.timeId);
				if(fn){
					fn();
				}
			}
		},time);
	}

	//大的轮播图
 	var cls1 = document.querySelector('.cls1')
 	var cls2 = document.querySelector('.cls2')
 	var flag = true;
 	var max = 3
 	var min = 2
 	var timer = setInterval(function(){
 		if(flag){
 			animate(cls2,{'opacity':0},100,function(){
 				cls2.style.zIndex = min;
 				cls1.style.zIndex = max;
 				cls1.style.opacity = 1;
 				cls2.style.opacity = 1;
 				flag = false;
 			})
 		}else{
 			animate(cls1,{'opacity':0},100,function(){
				cls2.style.zIndex = max;
 				cls1.style.zIndex = min;
 				cls1.style.opacity = 1;
 				cls2.style.opacity = 1;
 				flag = true;
 			})
 		}
 	},2000)

 	//小轮播动画函数
 	function lunboanimate(element, target,time) {
     	//清除定时器
     	clearInterval(element.timeId)
     	//element.timeId 定时器的名字
     	element.timeId = setInterval(function () {
       	//获取元素的一个当前left位置 
       	var current = element.offsetLeft
       	//要移动的步伐
        var step = 10;
        //目标位置跟当前位置的一个大小区分
        step = current > target ? -step : step;
  		current += step  //current = current + step
        //current-target 相差的距离
        if (Math.abs(current - target) > Math.abs(step)) {
            element.style.left = current + 'px'
        	}else{
            clearInterval(element.timeId)
            element.style.left = target + 'px'
        	}
         // if(current>=target){
         //   clearInterval(element.timeId)
         // }
         // element.style.left = current+'px'

     		},time)
 		}

	//小轮播
	var inner = document.querySelector('.inner');
	var imgWidth = inner.offsetWidth;
	var lunbo_ul = document.querySelector('.lunbo_ul');
	var dot = document.querySelector('.dot');
	var sps = dot.getElementsByTagName('span');
	var lunbo = document.querySelector('.lunbo');
	var timer = null;
	timer = setInterval(rightS,3000);
	lunbo.onmouseenter = function(){
		clearInterval(timer);
	}

	lunbo.onmouseleave = function(){
 		timer = setInterval(rightS,3000);
 	}
 	lunbo_ul.appendChild(lunbo_ul.children[0].cloneNode(true));
 	var pic = 0;
 	function rightS(){
 		if(pic==lunbo_ul.children.length-1){
 			pic = 0;
 			lunbo_ul.style.left = -pic*imgWidth;
 		}
 		pic++;
 		lunboanimate(lunbo_ul,-pic*imgWidth,15);

 		if(pic == lunbo_ul.children.length-1){
 			sps[0].className = "current";
 			sps[sps.length-1].className = "";
 		}else{
 			for(var i = 0;i<sps.length;i++){
 			sps[i].className = "";
 		}
 		sps[pic].className = "current";
 		}
	}
	for(var i = 0;i<sps.length;i++){
 		sps[i].setAttribute('index',i);
 		sps[i].onmouseenter = function(){
 			for(var k=0;k<sps.length;k++){
 				sps[k].className = "";
 			}
 			this.className = "current";
 			pic = this.getAttribute('index');
 			lunbo_ul.style.left = -pic*imgWidth + "px";
 		}
 	}


	//二维码
 	var wxli = document.querySelectorAll('.wxBox ul li');
 	var wximg = document.querySelectorAll('.wxBox ul li img');

 	for(var i = 0;i<wximg.length;i++){
 		wxli[i].onmouseenter = function(){
 			this.children[1].style.display = "block";
 		}
 		wxli[i].onmouseleave = function(){
 			this.children[1].style.display = "none";
 		}
 	}

 	//页面底部红色边框
 	var h2all = document.querySelectorAll('.bottom_nav ul li h2');
 	var redborder = document.querySelectorAll('.bottom_nav>ul>li');
 	for(var i = 0;i<redborder.length;i++){
 		h2all[i].onmouseenter = function(){
 			this.style.borderBottom = "2px solid red";
 		}
 	h2all[i].onmouseleave = function(){
 			this.style.borderBottom = "2px solid #999999";
 		}
 	}


 	function $class(aa){
 		return document.querySelector(aa);
 	}
 	
 	//导航栏的鼠标移入移出
 	$class('.li1').onmouseenter = function(){
 		$class('.one').style.display = "block";
 		this.style.backgroundColor = "#9b9393";
 	}
 	$class('.li1').onmouseleave = function(){
 		$class('.one').style.display = "";
 		this.style.backgroundColor = "";
 	}

 	$class('.li2').onmouseenter = function(){
 		$class('.two').style.display = "block";
 		this.style.backgroundColor = "#9b9393";
 	}
 	$class('.li2').onmouseleave = function(){
 		$class('.two').style.display = "";
 		this.style.backgroundColor = "";
 	}

 	$class('.li3').onmouseenter = function(){
 		$class('.three').style.display = "block";
 		this.style.backgroundColor = "#9b9393";
 	}
 	$class('.li3').onmouseleave = function(){
 		$class('.three').style.display = "";
 		this.style.backgroundColor = "";
 	}

 	$class('.li4').onmouseenter = function(){
 		this.style.backgroundColor = "#9b9393";
 	}
 	$class('.li4').onmouseleave = function(){
 		this.style.backgroundColor = "";
 	}

 	$class('.li5').onmouseenter = function(){
 		$class('.five').style.display = "block";
 		this.style.backgroundColor = "#9b9393";
 	}
 	$class('.li5').onmouseleave = function(){
 		$class('.five').style.display = "";
 		this.style.backgroundColor = "";
 	}